/**
 * Created by rongyao on 2017/11/16.
 */
import React from 'react'
import {Link} from 'react-router'
import {Provider, connect} from 'react-redux'
import {fetchComment,AddComment,addCar} from '../../actions/counter'
import "./shopCar.scss"
class ShopCar extends React.Component{
	
	render(){
		var {shopCar} = this.props;
		var list = shopCar.map(function (val, idx) {
			return (
				<li className="listCar">
					<p className="proNmae col-md-3">{val.name}</p>
					<p className="proPrice col-md-3">￥{val.price}</p>
					<p className="proCount col-md-3">1</p>
					<p className="col-md-3">￥{val.price}</p>
				</li>
			)
		})
		return (
			<div className="container">
				<div>
					<img src="./src/img/car.bmp" alt=""/>
				</div>
				<ul className="ulLi">
					<li className="listHead">
						<p className="proNmae col-md-3">产品名称</p>
						<p className="proPrice col-md-3">产品价格</p>
						<p className="proCount col-md-3">产品数量</p>
						<p className="proCount col-md-3">小计</p>
					</li>
					{list}
				</ul>
				
			</div>
		)
		
	}
}

const getValue = (state) => {
	return {
		newsList: state.newsList,
		cateList: state.cateList,
		commentList: state.commentList,
		productList: state.productList,
		shopCar: state.shopCar
	}
}
const ShopCarContext = connect(
	getValue,
	{fetchComment,AddComment,addCar}
)(ShopCar)
module.exports=ShopCarContext;
